package com.lantosec.hmrp;

import com.bstek.ureport.console.UReportServlet;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

@ImportResource("classpath:ureport-context.xml")
@SpringBootApplication
@MapperScan("com.lantosec.hmrp")
@EnableTransactionManagement //开启事务管理
@EnableCaching
@EnableWebMvc
@EnableScheduling
public class HmrpApplication {

    public static void main(String[] args) {
        SpringApplication.run(HmrpApplication.class, args);
    }

    @Bean
    public ServletRegistrationBean ureportServlet() {
        return new ServletRegistrationBean(new UReportServlet(), "/ureport/*");
    }
}
